package com.sxbbc.common.core.enums;

import com.sxbbc.common.basics.utils.calculation.CalcuUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangq
 * @description 提鸡券状态状态枚举
 * @date 2020-3-30
 */
public enum ChickenCouponStatusEnums {
	FROZEN(0,"冻结中"),
	WAITUSE(1,"待使用"),
	WAITCONFIRM(2,"已预约待核销"),
	USED(3,"已使用"),
	OVERDUE(4,"已失效"),  //已预约但过了预约日期没核销的或者过了提鸡有效期，有备注说明
	GIVING(5,"已转赠");

	private Integer id;

    private String name;

    public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	private ChickenCouponStatusEnums(Integer id, String name){
		this.id=id;
		this.name=name;
	}
	
	public static List<ChickenCouponStatusEnums> queryList(){
		List<ChickenCouponStatusEnums> list=new ArrayList<ChickenCouponStatusEnums>();
		for(ChickenCouponStatusEnums o: ChickenCouponStatusEnums.values()){
			list.add(o);
		}
		return list;
	}
	
	public static String getName(Integer id){
		String str="";
		for(ChickenCouponStatusEnums o: ChickenCouponStatusEnums.values()){
			if(CalcuUtils.getInstance().isEquals(id, o.getId())){
				str= o.getName();
				break;
			}
		}
		return str;
	}
}
